﻿/********************************************************************************************************************
* Author:	Aris Michail																							*
* Email:	std03055@di.uoa.gr																						*
* Purpose:	This script is used in order to create the stored procedure "usp_getEntityIds" that returns			 	*
*			the ids of all the entities from a category.															*
********************************************************************************************************************/

CREATE PROCEDURE [dbo].[usp_getEntityIds]
	@categoryid bigint
AS
	SELECT entities.id
	FROM entities
	WHERE entities.category = @categoryid and Entities.IsApproved != '0'
RETURN 0